import request from "@/utils/request.js";
/**
 * 未设置工厂分页查询
 * @param params
 */
export const pageList = query => {
  return request({
    url: "/purchase/factoryToBusinessLevel/setting/unset/page/" + query.businessLevelId,
    method: "get",
    params: query
  });
};

/**
 * 查询某个商家等级下 未设置、续约调整的个数
 * @param params
 */
export const businessLevelCount = query => {
  return request({
    url: "/purchase/factoryToBusinessLevel/setting/businessLevelCount/" + query,
    method: "get"
  });
};

/**
 * 查询未设置商家等级返佣的详情
 * @param params
 */
export const settingDetail = query => {
  return request({
    url: `/purchase/factoryToBusinessLevel/setting/unset/detail/${query.businessLevelId}/${query.factoryCommissionId}`,
    method: "get"
  });
};

/**
 * 提交商家等级返佣设置
 * @param params
 */
export const settingSubmit = data => {
  return request({
    url: "/purchase/factoryToBusinessLevel/setting/unset/submit",
    method: "post",
    data
  });
};

/**
 * 续约设置分页列表
 * @param params
 */
export const renewPage = query => {
  return request({
    url: `/purchase/factoryToBusinessLevel/setting/renew/page/${query.businessLevelId}`,
    method: "get",
    params: query
  });
};

/**
 * 查询续约设置详情
 * @param params
 */
export const renewDetail = query => {
  return request({
    url: `/purchase/factoryToBusinessLevel/setting/renew/detail/${query.businessLevelId}/${query.renewFactoryCommissionId}`,
    method: "get"
  });
};

/**
 * 提交调整续约返佣
 * @param params
 */
export const renewSubmit = data => {
  return request({
    url: "/purchase/factoryToBusinessLevel/setting/renew/submit",
    method: "post",
    data
  });
};



/**
 * 已设置分页列表
 * @param params
 */
export const alreadySetPage = query => {
  return request({
    url: `/purchase/factoryToBusinessLevel/setting/alreadySet/page/${query.businessLevelId}`,
    method: "get",
    params: query
  });
};

/**
 * 查询已设置详情
 * @param params
 */
export const alreadySetDetail = query => {
  return request({
    url: `/purchase/factoryToBusinessLevel/setting/alreadySet/detail/${query.businessLevelCommissionId}`,
    method: "get"
  });
};

/**
 * 编辑商家等级返佣比例
 * @param params
 */
export const alreadySetEdit = data => {
  return request({
    url: "/purchase/factoryToBusinessLevel/setting/alreadySet/ratio/edit",
    method: "post",
    data
  });
};
